package com.like.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.like.fragment.GuideFragment;
import com.like.hospitalworld.R;

public class GuidePagerAdapter extends FragmentPagerAdapter {

    private GuideFragment mGuide1Fragment = new GuideFragment();
    private GuideFragment mGuide2Fragment = new GuideFragment();
    private GuideFragment mGuide3Fragment = new GuideFragment();
    private GuideFragment mGuide4Fragment = new GuideFragment();
    private GuideFragment mGuide5Fragment = new GuideFragment();

    private GuideFragment[] mGuides = null;

    public GuidePagerAdapter(FragmentManager fm) {
        super(fm);
        mGuide1Fragment.setImg(R.drawable.guide1);
        mGuide2Fragment.setImg(R.drawable.guide2);
        mGuide3Fragment.setImg(R.drawable.guide3);
        mGuide4Fragment.setImg(R.drawable.guide4);
        mGuide5Fragment.setImg(R.drawable.guide5);
        mGuides = new GuideFragment[]{mGuide1Fragment, mGuide2Fragment, mGuide3Fragment, mGuide4Fragment, mGuide5Fragment};
    }

    @Override
    public Fragment getItem(int position) {
        return mGuides[position];
    }

    @Override
    public int getCount() {
        return mGuides.length;
    }
}
